# -*- coding: utf-8 -*-
# !/usr/bin/python

import os
import csv

# 少年遇见了少女

# 读取列表
def ReadList():
	fileCSV = currentPath + "\csv" + "\学生名单.csv"
	with open(fileCSV, encoding='utf-8') as FileCSV:
		csv_reader = csv.reader(FileCSV)
		return [row for row in csv_reader]

# 根据路径创建文件夹
def Mkdir(path): 
	folder = os.path.exists(path)    # 判定路径是否存在
	if not folder:                   # 判断是否存在文件夹如果不存在则创建为文件夹
		os.makedirs(path)            # makedirs 创建文件时如果路径不存在会创建这个路径

# 按照学生列表创建文件夹
def CreatStudentsFolder(studentsList):
	for item in studentsList:
		path = currentPath + "/Temporary" + "/" + item[0] + item[1]
		Mkdir(path)



def GetFolder():
	print("当前路径："+currentPath)
	StudentsList = ReadList()
	StudentsList.pop(0)				# 去表头
	CreatStudentsFolder(StudentsList)
	return StudentsList

currentPath = os.getcwd()		# 当前路径

if __name__ == "__main__":
	GetFolder()
	print("别让琐事挤走快乐！")
	input("Press Enter to continue...")

# 少年为少女做多余的事